<?php

$file='img.jpg';


   $file="storage/goods/201904115caefc2be7d88.jpg";

    $minetype = 'image/jpeg';
    $curl_file = curl_file_create($file, $minetype);

    $url = "https://upic.lvyuecp.com/api/Upload/fileUploadImage";
//$url = "https://admin.lvyuecp.com/upload.php";
    $post_data = ['img' => $curl_file];
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // https请求 不验证证书和hosts
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
    $output = curl_exec($ch);
    curl_close($ch);


    die;






function p($ar){
    echo '<pre>';
    if(is_array($ar)){
        print_r($ar);
    }else{
        var_dump($ar);
    }
    echo '</pre>';
}

if($_POST){

    p($_FILES);
    p($_POST);
}


 ?>


<html>

<title>图片上传测</title>
<body>


<form action="" method="post" enctype="multipart/form-data">

    <input name="aa" ><p />
    <input type="file" name="img"><p />

    <button>上传</button>

</form>


</body>

</html>
